<?php
namespace App\Models;
use Illuminate\Support\Facades\DB;

class ShopStore extends CommonModel {
	protected $table = 'shop_store';

    /**
     * @param $store_id
     * @return \Illuminate\Database\Eloquent\Model|null|static
     */
    public function getStoreDetailById($store_id){
        return DB::table('shop_store')->where(['id'=>$store_id])->select('id','store_name','uid','store_mobile','work_start_time','work_end_time','village_ids','start_amount','shipping_amount','average_amount','send_time','is_open')->first();
    }

    /**
     * @param $store_id
     * @return mixed
     */
    public function getStoreUid($store_id){
        return DB::table('shop_store')->where(['id'=>$store_id])->value('uid');
    }

    public function getVillageIdByStore($store_id){
        return DB::table('shop_store')->where(['id'=>$store_id])->value('village_id');
    }
}